# Create your views here.
from django.views.generic import list_detail
from models import News

def news_by_language(request):

    # Use the object_list view for the heavy lifting.
    language = request.LANGUAGE_CODE
    return list_detail.object_list(
        request,
        queryset = News.published.filter(language=language),
        template_name = "news/news_by_language.html",
        template_object_name = "news",
    )
